package statemode;

import buildermode.Zh0202Player;

/**
 * @author: zh
 * @date: 2021/12/17 21:14
 * @version: 1.0
 */
public class Zh0202NormalState extends Zh0202State {
    public Zh0202NormalState(Zh0202State state) {
        this.blood = state.blood;
        this.player = state.player;
    }

    public Zh0202NormalState(Zh0202Player player) {
        this.blood = 100;
        this.player = player;
    }


    @Override
    public void shoot() {
        super.shoot();
    }

    @Override
    public void move() {
        super.move();
    }

    @Override
    public void attacked() {
        super.attacked();
    }

    @Override
    public void checkState() {
        if (blood <= 0) {
            player.setState(new Zh0202DeadState(this));
            System.out.println("很遗憾，您已经死掉了！");
        }
    }

    @Override
    public String toString() {
        return "Zh0202NormalState{" +
                "blood=" + blood +
                '}';
    }
}
